import { createRouter, createWebHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'main',
    component: function () {
      return import('../views/home.vue')
    },
    children: [
      {
        path: '/',
        name: 'home',
        component: () => import('../views/homeViews/home.vue'),
      },
      {
        path: '/search',
        name: 'search',
        component: () => import('../views/homeViews/search.vue'),
      },
      {
        path: '/fillApplication',
        name: 'fillApplication',
        component: () => import('../views/homeViews/fillApplication.vue'),
      },
      {
        path: '/qaArea',
        name: 'qaArea',
        component: () => import('../views/homeViews/qaArea.vue'),
      },
      {
        path: '/consult',
        name: 'consult',
        component: () => import('../views/homeViews/consult.vue'),
      },
      {
        path: '/user',
        name: 'user',
        component: () => import('../views/homeViews/user.vue'),
      },
      {
        path: '/navigation',
        name: 'navigation',
        component: () => import('../views/homeViews/navigation.vue'),
      },
    ],
  },
  {
    path: '/login',
    name: 'login',
    component: function () {
      return import('../views/login.vue')
    }
  },
  {
    path: '/bg',
    name: 'background',
    component: function () {
      return import('../views/background.vue')
    },
    children: [
      {
        path: '/bg/home',
        name: 'bg_home',
        component: () => import('../views/bgViews/home.vue'),
      },
      {
        path: '/bg/account',
        name: 'bg_account',
        component: () => import('../views/bgViews/account.vue'),
      },
      {
        path: '/bg/scoreRanks',
        name: 'bg_scoreRanks',
        component: () => import('../views/bgViews/scoreRanks.vue'),
      },
      {
        path: '/bg/volunteer',
        name: 'bg_volunteer',
        component: () => import('../views/bgViews/volunteer.vue'),
      },
      {
        path: '/bg/school',
        name: 'bg_school',
        component: () => import('../views/bgViews/school.vue'),
      },
      {
        path: '/bg/special',
        name: 'bg_special',
        component: () => import('../views/bgViews/special.vue'),
      },
      {
        path: '/bg/schoolSpecial',
        name: 'bg_schoolSpecial',
        component: () => import('../views/bgViews/schoolSpecial.vue'),
      },
      {
        path: '/bg/crawler',
        name: 'bg_crawler',
        component: () => import('../views/bgViews/crawler.vue'),
      },
      {
        path: '/bg/banner',
        name: 'bg_banner',
        component: () => import('../views/bgViews/banner.vue'),
      },
      {
        path: '/bg/card',
        name: 'bg_card',
        component: () => import('../views/bgViews/card.vue'),
      },
      {
        path: '/bg/dboperator',
        name: 'bg_dboperator',
        component: () => import('../views/bgViews/dboperator.vue'),
      },
      {
        path: '/bg/setting',
        name: 'bg_setting',
        component: () => import('../views/bgViews/setting.vue'),
      },
    ],
  },
  {
    path: '/dev',
    name: 'dev',
    component: function () {
      return import('../views/dev.vue')
    }
  },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
